<template>
  <br>
  <h3 style="color: red"><strong>{{title}}</strong></h3> <br>
  <input type="text" v-model="username"/>
  <button @click="clearData">重置</button>


<!-- v-model 修饰符 .lazy  .number .trim -->
</template>

<script>
export default {
  name: "Demo",
  data(){
    return{
      title:"19.表单输入绑定",
      username:""
    }
  },
  watch:{
    username(newValue,oldValue){
      console.log(newValue)
    }
  },
  methods:{
    clearData(){
      this.username = "";
    }
  }
}
</script>

<style scoped>

</style>